package com.huanong.controller;
/*
 *@Author:anran
 *@Date:2020/12/7
 *@Version 1.0
 */


import com.huanong.common.grace.result.GraceJSONResult;
import com.huanong.pojo.NewWork;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.websocket.server.PathParam;

@Api(value = "新闻信息管理",tags = {"新闻信息管理"})
@RequestMapping("/news")
@CrossOrigin(origins = "*")
public interface NewsControllerApi {

    @ApiOperation(value = "查询新闻接口",notes = "查询新闻",httpMethod = "GET")
    @GetMapping("/queryNews")
    public GraceJSONResult query();

    @ApiOperation(value = "根据id查询新闻接口",notes = "根据id查询新闻",httpMethod = "GET")
    @GetMapping("/queryNewsById")
    public GraceJSONResult queryById(@RequestParam("NkId") Integer NkId);

    @ApiOperation(value = "添加新闻信息接口",notes = "添加新闻信息",httpMethod = "POST")
    @PostMapping("/addNews")
    public GraceJSONResult addNews(@RequestBody NewWork newWork);

    @ApiOperation(value = "删除新闻信息接口",notes = "删除新闻信息",httpMethod = "GET")
    @GetMapping("/deleteNews")
    public GraceJSONResult delete(@RequestParam("NkId") Integer NkId);

    @ApiOperation(value = "更新新闻信息接口",notes = "更新新闻信息",httpMethod = "POST")
    @PostMapping("/updateNews")
    GraceJSONResult updateNews(@RequestBody NewWork newWork);
}
